﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="GroupProfile.aspx.vb"
    Inherits="HauntedNetworkingSite.GroupProfile" %>

<%@ Register Src="Banner.ascx" TagName="Banner" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .style1
        {
            width: 220px;
        }
        .style2
        {
            width: 137px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <uc1:Banner ID="Banner1" runat="server" />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <h1>
            &nbsp;</h1>
        <h1 class="style1">
            &nbsp;</h1>
        <br />
        <table class="style1">
            <tr>
                <td class="style2" valign="top">
                    <asp:Image ID="image_GroupImage" runat="server" AlternateText="No Image Uploaded"
                        Height="250px" ImageAlign="Left" GenerateEmptyAlternateText="true" ToolTip="Group Image"
                        Width="200px" />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                </td>
                <td valign="top" class="style4">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:LinkButton ID="linkButton_JoinGroup" runat="server" CssClass="textColour" 
                        Font-Size="1.2em">Join 
                    Group</asp:LinkButton><br />
                    <br />
                    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
                        DataSourceID="GroupProfileDataSource" Height="50px" Width="100%" GridLines="None"
                        RowStyle-HorizontalAlign="Left" FieldHeaderStyle-CssClass="titleclass" 
                        DataKeyNames="ID">
                        <RowStyle HorizontalAlign="Left" />
                        <FieldHeaderStyle CssClass="titleclass" />
                        <Fields>
                            <asp:BoundField DataField="GroupName" HeaderText="GroupName" 
                                SortExpression="GroupName" />
                            <asp:HyperLinkField DataNavigateUrlFields="UserName" 
                                DataNavigateUrlFormatString="ShowGroupsByUser.aspx?UserName={0}" 
                                DataTextField="UserName" HeaderText="Created By" />
                            <asp:BoundField DataField="GroupLocation" HeaderText="GroupLocation" 
                                SortExpression="GroupLocation" />
                            <asp:BoundField DataField="Description" HeaderText="Description" 
                                SortExpression="Description" />
                        </Fields>
                    </asp:DetailsView>
                    <asp:SqlDataSource ID="GroupProfileDataSource" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" 
                        
                        
                        SelectCommand="SELECT [ID], [GroupName], [UserName], [GroupLocation], [Description] FROM [groups] WHERE ([ID] = ?)">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <br />
                    <asp:DataList ID="DataList1" runat="server" 
                        DataSourceID="GroupMembersDataSource" RepeatColumns="3" 
                        RepeatDirection="Horizontal" CellSpacing="1" CssClass="gridclass">
                        <ItemTemplate>
                            <asp:Image ID="Image1" runat="server" 
                                ImageUrl='<%# Eval("UserName", "{0}") %>' />
                            <br />
                            <asp:HyperLink ID="HyperLink2" runat="server" 
                                NavigateUrl='<%# Eval("UserName", "memberprofile.aspx?UserName={0}") %>' 
                                Text='<%# Eval("UserName", "{0}") %>'></asp:HyperLink>
                            <br />
                            <br />
                        </ItemTemplate>
                    </asp:DataList>
                    <asp:SqlDataSource ID="GroupMembersDataSource" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" 
                        
                        
                        
                        SelectCommand="SELECT [GroupName], [UserName] FROM [MembersByGroupsQuery] WHERE ([ID] = ?)">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
                <td class="style4" valign="top">
                    <asp:ListView ID="ListView1" runat="server" 
                        DataSourceID="GroupCommentsDataSource">
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server" 
                                NavigateUrl='<%# Eval("User", "memberprofile.aspx?User={0}") %>' 
                                Text='<%# Eval("User") %>' ToolTip="Go to this User's profile Page"></asp:HyperLink>
                            <br />
                            DatePosted:
                            <asp:Label ID="DatePostedLabel" runat="server" Text='<%# Eval("DatePosted") %>'></asp:Label>
                            <br />
                            Comment:
                            <asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>'></asp:Label>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <span style="">User:
                            <asp:Label ID="UserLabel" runat="server" Text='<%# Eval("User") %>' />
                            <br />
                            DatePosted:
                            <asp:Label ID="DatePostedLabel" runat="server" 
                                Text='<%# Eval("DatePosted") %>' />
                            <br />
                            Comment:
                            <asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>' />
                            <br />
                            <br />
                            </span>
                        </AlternatingItemTemplate>
                        <EmptyDataTemplate>
                            <span>No comments added yet.</span>
                        </EmptyDataTemplate>
                        <InsertItemTemplate>
                            <span style="">User:
                            <asp:TextBox ID="UserTextBox" runat="server" Text='<%# Bind("User") %>' />
                            <br />
                            DatePosted:
                            <asp:TextBox ID="DatePostedTextBox" runat="server" 
                                Text='<%# Bind("DatePosted") %>' />
                            <br />
                            Comment:
                            <asp:TextBox ID="CommentTextBox" runat="server" Text='<%# Bind("Comment") %>' />
                            <br />
                            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                                Text="Insert" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                                Text="Clear" />
                            <br />
                            <br />
                            </span>
                        </InsertItemTemplate>
                        <LayoutTemplate>
                            <div ID="itemPlaceholderContainer" runat="server" style="">
                                <span style="" >
                                &nbsp;<span ID="itemPlaceholder" runat="server"></span>
                                <br />
                                <br />
                                <br />
                                <br />
                                </span>
                                </span>
                            </div>
                            <div style="">
                            </div>
                        </LayoutTemplate>
                        <EditItemTemplate>
                            <span style="">User:
                            <asp:TextBox ID="UserTextBox" runat="server" Text='<%# Bind("User") %>' />
                            <br />
                            DatePosted:
                            <asp:TextBox ID="DatePostedTextBox" runat="server" 
                                Text='<%# Bind("DatePosted") %>' />
                            <br />
                            Comment:
                            <asp:TextBox ID="CommentTextBox" runat="server" Text='<%# Bind("Comment") %>' />
                            <br />
                            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                                Text="Update" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                                Text="Cancel" />
                            <br />
                            <br />
                            </span>
                        </EditItemTemplate>
                        <SelectedItemTemplate>
                            <span style="">User:
                            <asp:Label ID="UserLabel" runat="server" Text='<%# Eval("User") %>' />
                            <br />
                            DatePosted:
                            <asp:Label ID="DatePostedLabel" runat="server" 
                                Text='<%# Eval("DatePosted") %>' />
                            <br />
                            Comment:
                            <asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>' />
                            <br />
                            <br />
                            </span>
                        </SelectedItemTemplate>
                    </asp:ListView>
                    <asp:SqlDataSource ID="GroupCommentsDataSource" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" 
                        SelectCommand="SELECT [User], [DatePosted], [Comment] FROM [GroupComments] WHERE ([Group_fkid] = ?)">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="Group_fkid" QueryStringField="ID" 
                                Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    &nbsp;
                </td>
                <td valign="top" class="style4">
                    &nbsp;
                </td>
            </tr>
        </table>
        <br />
        <br />
    </div>
    </form>
</body>
</html>
